#!/usr/bin/env python  
# encoding: utf-8


""" 
@version: v1.0 
@author: Shylock 
@license: Apache Licence  
@contact: JYFelt@163.com 
@site: http://blog.csdn.net/weixin_38034182 
@software: PyCharm Community Edition 
@file: MainPage.py 
@time: 2017/12/22 11:27 
"""
from tkinter import *
import CInfoPage as Cinfo
import QInfoPage as Qinfo
import LoginPage as LP

class MainPage(object):
    def __init__(self, master=None):
        self.root = master  # 定义内部变量
        self.root.geometry('250x730')  # 设置窗口大小
        self.root.resizable(0, 0)
        self.ChoosePage()

    def ChoosePage(self):
        self.page = Frame(self.root)
        self.page.pack()
        self.Button = self.Button()

    def Button(self):
        Button(self.page, text='注册单位信息', width=30, height=4, command=self.jump_1).pack()

        Button(self.page, text='注册求职者信息', width=30, height=4, command=self.jump_5).pack()

        Button(self.page, text='查询单位信息', width=30, height=4, command=self.jump_2).pack()

        Button(self.page, text='查询求职者信息', width=30, height=4, command=self.jump_6).pack()

        Button(self.page, text='修改单位信息', width=30, height=4, command=self.jump_3).pack()

        Button(self.page, text='修改求职者信息', width=30, height=4, command=self.jump_7).pack()

        Button(self.page, text='关于系统', width=30, height=4, command=self.jump_4).pack()

        Button(self.page, text='注销', width=30, height=4, command=self.jump_8).pack()

        Button(self.page, text='退出', width=30, height=4, command=self.jump_9).pack()



    def jump_1(self):
        self.page.destroy()
        Cinfo.insertPage(self.root)

    def jump_2(self):
        self.page.destroy()
        Cinfo.searchPage(self.root)

    def jump_3(self):
        self.page.destroy()
        Cinfo.modifyPage(self.root)

    def jump_4(self):
        self.page.destroy()
        Cinfo.aboutPage(self.root)

    def jump_5(self):
        self.page.destroy()
        Qinfo.insertPage(self.root)

    def jump_6(self):
        self.page.destroy()
        Qinfo.searchPage(self.root)

    def jump_7(self):
        self.page.destroy()
        Qinfo.modifyPage(self.root)

    def jump_8(self):
        self.page.destroy()
        LP.LoginPage(self.root)

    def jump_9(self):
        self.page.destroy()
        self.root.quit()

